var ws, aid;
document.addEventListener('plusready', function(){
	ws = plus.webview.currentWebview();
	aid = ws.aid;
	console.log(aid);
	showWating();
	console.log(apiRoot+"/home/drugorder/drugInfo/aid/"+aid);
	$.ajax({
		type:"get",
		url:apiRoot+"/home/drugorder/drugInfo",
		data:{aid:aid},
		dataType :'json',
		success :function(data){
			plus.nativeUI.closeWaiting();
//			console.log(JSON.stringify(data));
			$('.name').text(data.name);
			$('.phone').text(data.phone);
			$('.address').text(data.address);
			$('.maths').text('创建时间：'+data.addtime);
			$('.status').text(data.status==0?'进行中':'已完成');
			var list = '';
			$.each(data.drug, function(k, v) {
				list += '<ul class="mui-table-view">'+
					'<li class="mui-table-view-cell mui-media" onclick="">'+
						'<a href="javascript:;">'+
							'<img class="mui-media-object mui-pull-left" src="'+getAvatar(v.photo)+'">'+
							'<div class="mui-media-body">'+
								v.title+
								'<p class="mui-ellipsis">¥10.00/g<span class="mui-pull-right rightnub">×1</span></p>'+
							'</div>'+
						'</a>'+
					'</li>'+
				'</ul>';
			});
			$('.druglist').html(list);
		},
		error :function(e){
			console.log(JSON.stringify(e));
			errortoast();
		}
	});
}, false)